#pragma once
#include "ThreadSafer.h"
#include "NetMessage.h"
#include <list>
using namespace std;

namespace _FOGGE_
{
	namespace _NET_
	{

		class UnreliableOutQueue 
			: public _FOGGE_::_THREAD_::ThreadSafer
		{
			list<UDPNetMessage *>	m_Messages;
			DWORD               m_dwCurrentMessageID;
			foUChar       m_ucMaxMessages;
			foUChar       m_ucNumMessages;
			_FOGGE_::_THREAD_::ThreadBlocker		m_Blocker;
			
		public:
			UnreliableOutQueue();
			virtual ~UnreliableOutQueue();
			
			void  Clear();
			void  AddMessage( UDPNetMessage* ptrMessage);
			const UDPNetMessage*  GetPreviousMessage( DWORD msgID);
			void ReturnMessage(const UDPNetMessage ** ptrptrMessage);
			void  SetMaxMessages( foUChar maxMessages );
			
			
			inline DWORD GetCurrentID() { return m_dwCurrentMessageID;	}
		};
	}
}
